/**
 * 接口请求
 */
import request from '../utils/request'

//获取用户的基本信息和岗位推荐
export const getUserInfo = data => {
  return request({
    method: 'POST',
    url: '/web/person/index',
    params: data
  })
}

//添加用个人简历
export const addMyResume = data => {
  return request({
    headers: { 'Content-Type': 'application/json' },
    method: 'POST',
    url: '/web/person/addMyResume',
    data: JSON.stringify(data)
  })
}

//获取用户个人简历信息
export const getResumeDetails = data => {
  return request({
    method: 'POST',
    url: '/web/person/getResumeDetails',
    params: data
  })
}

//获取用户申请的简历列表
export const getPositionAppliedList = data => {
  return request({
    method: 'POST',
    url: '/web/person/positionAppliedList',
    params: data
  })
}

//清除简历
export const cleanResume = data => {
  return request({
    method: 'POST',
    url: '/web/person/clearResume',
    params: data
  })
}

//获取用户收藏的职位
export const getCollectionPositionList = data => {
  return request({
    method: 'POST',
    url: '/web/person/collectionPositionList',
    params: data
  })
}

//获取用户收藏的公司
export const getFollowCompanyList = data => {
  return request({
    method: 'POST',
    url: '/web/person/followCompanyList',
    params: data
  })
}

//删除收藏的职位
export const delCollectionPositionByIdList = data => {
  return request({
    method: 'POST',
    url: '/web/person/delCollectionPosition',
    params: data
  })
}

//删除收藏的职位
export const delFollowCompanyByIdList = data => {
  return request({
    method: 'POST',
    url: '/web/person/delFollowCompany',
    params: data
  })
}

//绑定邮箱
export const bindEmailByUid = data => {
  return request({
    method: 'POST',
    url: '/web/person/bindEmail',
    params: data
  })
}

//获取用户简历相关的一些信息和状态
export const getAccountDetails = data => {
  return request({
    method: 'POST',
    url: '/web/person/accountDetails',
    params: data
  })
}

//检验密码
export const checkPassword = data => {
  return request({
    method: 'POST',
    url: '/web/person/checkPassword',
    params: data
  })
}

//保存用户修改密码
export const updatePassword = data => {
  return request({
    method: 'POST',
    url: '/web/person/updatePassword',
    params: data
  })
}

//更换简历状态
export const changedResumeStatus = data => {
  return request({
    method: 'POST',
    url: '/web/person/changedResumeStatus',
    params: data
  })
}

//保存用户基本资料
export const saveBaseDataFormByUid = data => {
  return request({
    headers: { 'Content-Type': 'application/json' },
    method: 'POST',
    url: '/web/person/saveBaseData',
    data: JSON.stringify(data)
  })
}

//获取用户的基本信息
export const getUserDetails = data => {
  return request({
    method: 'POST',
    url: '/web/person/getUserDetails',
    params: data
  })
}

//获取职位详情
export const getPostsDetails = data => {
  return request({
    method: 'POST',
    url: '/web/person/getPostsDetails',
    params: data
  })
}

//刷新简历时间
export const refreshResume = data => {
  return request({
    method: 'POST',
    url: '/web/person/refreshResume',
    params: data
  })
}

//获取岗位推荐列表
export const getPostList = data => {
  return request({
    method: 'POST',
    url: '/web/person/getPostList',
    params: data
  })
}

//收藏职位
export const collectionPost = data => {
  return request({
    method: 'POST',
    url: '/web/person/collectionPost',
    params: data
  })
}

//关注公司
export const followCompanyByCid = data => {
  return request({
    method: 'POST',
    url: '/web/person/followCompanyByCid',
    params: data
  })
}

//申请该职位
export const applyByPost = data => {
  return request({
    method: 'POST',
    url: '/web/person/applyByPost',
    params: data
  })
}

// 获取通知消息列表
export const getNewsList = data => {
  return request({
    method: 'POST',
    url: '/web/person/getNewsList',
    params: data
  })
}

// 文件上传
export function planUpFile(param) {
  return request({
    url: '/wx/uploadFile',
    method: 'post',
    data: param,
  });
}

//保存用户上传个性简历
export const updateFileByUID = data => {
  return request({
    method: 'POST',
    url: '/web/person/updateFile',
    params: data
  })
}

//获取用户pdf个性简历
export const getResumePdfFile = data => {
  return request({
    method: 'POST',
    url: '/web/person/getResumePdfFile',
    params: data
  })
}

//删除pdf个性文件
export const deletePdfFile = data => {
  return request({
    method: 'POST',
    url: '/web/person/deletePdfFile',
    params: data
  })
}
